package br.com.fatecpg.calcbf;

import com.example.calcbf.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void calcular(View view) {
    	Intent intent = new Intent(this, ResultadoActivity.class);
    	EditText peso = (EditText) findViewById(R.id.peso);
    	EditText circCintura = (EditText) findViewById(R.id.circCintura);
    	
    	if(peso.getText().toString().equals("")){
    		Toast.makeText(MainActivity.this, "Preencha o campo 'Peso'", Toast.LENGTH_LONG).show();
    	}else if(circCintura.getText().toString().equals("")){
    		Toast.makeText(MainActivity.this, "Preencha o campo 'Circunferência da Cintura'", Toast.LENGTH_LONG).show();
    	}
    	
    	
    	
    	
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
}
